
<?php
/**
 * Save web page as a file
 * 
 * @author hkpickup
 */
$f = fopen('generate-copy-of-file.html', 'w') or die($php_errormsg);
$url = "http://hk.yahoo.com";
$c = curl_init($url);
curl_setopt($c, CURLOPT_FILE, $f);		// save web page as a file 
curl_close($c);
echo 'created';

header("Location: ./generate-copy-of-file.html");	// redirect browser
exit;
?>